/**
 * 
 */
package de.cbf.cam.dsa.model.entities.weapon.valueModifier;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.entities.weapon.OneWeapon;
import de.cbf.cam.dsa.model.entities.weapon.WeaponMelee;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class WeaponTPKKModifier extends WeaponValueModifier {
	/**
	 * @uml.property  name="kkMod"
	 */
	private int kkMod;
	/**
	 * @uml.property  name="stepMod"
	 */
	private int stepMod;
	
	public WeaponTPKKModifier(int type, int kkMod, int stepMod) {
		super(type);
		this.kkMod = kkMod;
		this.stepMod = stepMod;
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.entities.weapon.valueModifier.WeaponValueModifier#modifyWeaponValue(de.cbf.cam.dsa.model.entities.weapon.OneWeapon)
	 */
	@Override
	public void modifyWeaponValue(OneWeapon weapon) {
		if (weapon instanceof WeaponMelee) {
			WeaponMelee weaponMelee = (WeaponMelee) weapon;
			weaponMelee.setKKTreshold(weaponMelee.getKKTreshold()+kkMod);
			weaponMelee.setKKStep(weaponMelee.getKKStep()+stepMod);
		}	
	}

	@Override
	public void unModifyWeaponValue(OneWeapon weapon) {
		if (weapon instanceof WeaponMelee) {
			WeaponMelee weaponMelee = (WeaponMelee) weapon;
			weaponMelee.setKKTreshold(weaponMelee.getKKTreshold()-kkMod);
			weaponMelee.setKKStep(weaponMelee.getKKStep()-stepMod);
		}	
	}

	/**
	 * @return
	 * @uml.property  name="kkMod"
	 */
	public int getKkMod() {
		return kkMod;
	}

	/**
	 * @param kkMod
	 * @uml.property  name="kkMod"
	 */
	public void setKkMod(int kkMod) {
		this.kkMod = kkMod;
	}

	/**
	 * @return
	 * @uml.property  name="stepMod"
	 */
	public int getStepMod() {
		return stepMod;
	}

	/**
	 * @param stepMod
	 * @uml.property  name="stepMod"
	 */
	public void setStepMod(int stepMod) {
		this.stepMod = stepMod;
	}	
}
